import { createStore } from "vuex"

import createPersistedstate from 'vuex-persistedstate'

export default createStore({
    namespaced: true,
    state: {
        //用户信息
        loginUserInfo: null,
        //是否展示登录
        articleId: "",
        userId:"",
        notice:{}
    
    },
    getters: {
        loginUserInfo: (state) => {
            return state.loginUserInfo;
        }
    },
    mutations: {
        updataLoginUserInfo(state, value) {
            state.loginUserInfo = value;
        },
        joinArticleId(state, value) {
            state.articleId = value
        },
        joinUserId(state, value){
            state.userId = value
        },
        joinNotice(state,value){
            state.notice = value
        }


    },
    actions: {},
    modules: {},

    plugins: [
        createPersistedstate({
            key: 'userInfo'
        })
    ]
})